import { createRouter, createWebHistory } from 'vue-router'
import Layout from "@/layout/Layout.vue"
import User from '@/views/users/index.vue'
import Department from '@/views/departments/index.vue'
import Leaves from '@/views/leaves/index.vue'
import Attendance from '@/views/attendance/Attendance.vue'
import Positions from '@/views/positions/index.vue'
import Salariesbenefits from '@/views/salariesbenefits/index.vue'
import Login from '@/views/Login.vue'
import Register from '@/views/Register.vue'
import Clock from '@/views/clockin/index.vue'
import Employeeleaves from '@/views/usersleaves/index.vue'
import Position from '@/views/positions/index.vue'
import Statistics from '@/views/statistics/index.vue'
import Allleaves from '@/views/leaves/allleaves.vue'


const routes = [
  {
    path: '/',
    name: 'Layout',
    component: Layout,
    redirect: "/login",
    children:[
      {
        path: '/users',
        name: 'User',
        component: User
      }  ,
      {
        path: '/departments',
        name: 'Department',
        component: Department
      },{
        path: '/position',
        name: 'Position',
        component: Position
      },
      {
        path: '/leaves',
        name: 'Leaves',
        component: Leaves
      },
      {
        path: '/attendance',
        name: 'Attendance',
        component: Attendance
      },
      {
        path: '/positions',
        name: 'Positions',
        component: Positions
      },
      {
        path: '/salariesbenefits',
        name: 'Salariesbenefits',
        component: Salariesbenefits
      },
      {
        path: '/clock',
        name: 'Clock',
        component: Clock
      },{
        path: '/employeeleaves',
        name: 'Employeeleaves',
        component: Employeeleaves
      },{
        path: '/statistics',
        name: 'Statistics',
        component: Statistics
      },{
        path: '/allleaves',
        name: 'Allleaves',
        component: Allleaves
      },
    ]
  },
  {
    path: '/login',
    name: 'Login',
    component: Login
  },
  {
    path: '/register',
    name: 'Register',
    component: Register
  }, 
 

]

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes
})

export default router
